<template>
    <div>
        <div><slot name="dlog"></slot></div>
        <button v-for="(item,index) in txt" :key='index' v-on:click=greet(item.mes)>{{item.btn}}</button>
    </div>
</template>

<script>
export default {
data(){
    return{
      txt:[{
        btn:'警告',
        mes:'警告提示'
      },{
        btn:'成功',
        mes:'成功提示'
      },{
        btn:'失败',
        mes:'失败提示'
      },{
        btn:'危险',
        mes:'危险提示'
      },{
        btn:'错误',
        mes:'错误提示'
      }]
    }
  },
   methods: {
    greet: function (mes) {
      alert(mes)
    }
  }
}
</script>

<style>

</style>